using UnityEngine;

public class PlayerState_WallJump : PlayerState
{
    public PlayerState_WallJump(Player player, PlayerStateMachine stateMachine, string animBoolName) : base(player, stateMachine, animBoolName)
    {
    }

    public override void Enter()
    {
        base.Enter();
        player.controller.Flip();
        player.Movement(player.controller.forward);
        player.movement.Jump();
    }

    public override void Exit()
    {
        base.Exit();
        if (MoveActionValue.x != player.controller.forward.x)
        {
            player.controller.Flip();
        }
    }

    public override void Update()
    {
        base.Update();
        
        // player.Movement(new Vector3(MoveActionValue.x, 1, MoveActionValue.y));
        if (player.movement.GetVelocity().y <= 0)
        {
            stateMachine.ChangeState(player.airState);
        }
    }
}
